package com.demo.log;

import ch.qos.logback.core.PropertyDefinerBase;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author wangfengchen
 */
public class HostNamePropertyDefiner extends PropertyDefinerBase {
  @Override
  public String getPropertyValue() {

    try {
      return InetAddress.getLocalHost().getHostAddress();
    } catch (UnknownHostException e) {
      e.printStackTrace();
    }
    return null;
  }
}

